<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>SWANSOFT 管理端</title>
<!--{{include file="./frame_js_css.html"}}-->
<script type="text/javascript" src="<!--{{$URL_JS_DEVICE_MANAGE_ADMIN}}-->" ></script>
<script type="text/javascript">
var gUrlPrefix = "<!--{{$URL_PREFIX_ADMIN}}-->";
var gMode = "<!--{{$mode}}-->";
var gDeviceManage = new DeviceManage();
gDeviceManage.setThisName('gDeviceManage');
gDeviceManage.init();
</script>
<style>
</style>
</head>
<body>
<div id="container">
<div class="content">
	<div id="head_notice" class="head_notice">
		<!--{{if 'mod' == $mode}}-->
		<h3>修改设备<a class="icons_gray icons_help" id="help_notice"></a></h3>
		<!--{{else}}-->
		<h3>添加设备<a class="icons_gray icons_help" id="help_notice"></a></h3>
		<!--{{/if}}-->
	</div>
	<div class="tips" style="display:none;" id="tips">
		<p>1.设备的显示名不能为空</p>	
		<p>2.主机名必须是正确的IP地址</p>	
		<p>3.如果选择V1/V2的SNMP协议则必须填写共同体</p>	
	</div>
	<form name="form1" id="form1">
	<table class="ltmtab tab_set">
	<colgroup>
		<col width="150px">
		<col>
	</colgroup>
	<!--{{if 'mod' == $mode}}-->
	<tbody>
		<tr>
			<th>设备名称</th>
			<td>
			<span><!--{{$data.device_name}}--></span>
			<input type="hidden" name="device_id" value="<!--{{$data.device_id}}-->"/>
			</td>
		</tr>
		<tr>
			<th>设备显示名称</th>
			<td><input class="text wtd1" type="text" name="device_display_name" id="device_display_name" value="<!--{{$data.device_display_name}}-->"/></td>
		</tr>
		<tr>
			<th>主机名-端口</th>
			<td>
				<input class="text wtd1" type="text" name="host" id="device_host" value="<!--{{$data.host}}-->"/>
				<span  class="add-on add-on-mid">:</span>
				<input class="text wtd2" type="text" name="port" id="device_port" value="<!--{{$data.port}}-->"/>
				<span id="host_port" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 版本</th>
			<td>
				<input type="radio" id="version_one" name="snmp_version" value="0" <!--{{if 0 == $data.snmp_version}}-->checked="checked"<!--{{/if}}-->/>
				<label for="version_one">VERSION_1</label>
				<input type="radio" id="version_two" name="snmp_version" value="1" <!--{{if 1 == $data.snmp_version}}-->checked="checked"<!--{{/if}}-->/>
				<label for="version_two">VERSION_2</label>
				<input type="radio" id="version_three" name="snmp_version" value="2" <!--{{if 2 == $data.snmp_version}}-->checked="checked"<!--{{/if}}-->/>
				<label for="version_three">VERSION_3</label>
				<span id ="snmp_version" class="form_boxy_span"></span>
			</td>
		</tr>
	</tbody>
	<tbody id="version_auth" <!--{{if 2 != $data.snmp_version}}-->style="display:none;"<!--{{/if}}-->>
		<tr>
			<th>认证用户名</th>
			<td><input class="text wtd1" type="text" name="security_name" id="security_name" value="<!--{{$data.security_name}}-->"/></td>
		</tr>
		<tr>
			<th>安全等级</th>
			<td>
				<input type="radio" id="no_auth" name="security_level" value="0" <!--{{if 0 == $data.security_level}}-->checked="checked"<!--{{/if}}-->/>
				<label for="no_auth">noAuthNoPriv</label>
				<input type="radio" id="auth_no_priv" name="security_level" value="1" <!--{{if 1 == $data.security_level}}-->checked="checked"<!--{{/if}}-->/>
				<label for="auth_no_priv">authNoPriv</label>
				<input type="radio" id="auth_priv" name="security_level" value="2" <!--{{if 2 == $data.security_level}}-->checked="checked"<!--{{/if}}-->/>
				<label for="auth_priv">authPriv</label>
				<span id ="security_level" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>认证算法</th>
			<td>
				<input type="radio" id="auth_md5" name="auth_protocol" value="0" <!--{{if 0 == $data.auth_protocol}}-->checked="checked"<!--{{/if}}-->/>
				<label for="auth_md5">MD5</label>
				<input type="radio" id="auth_sha" name="auth_protocol" value="1" <!--{{if 1 == $data.auth_protocol}}-->checked="checked"<!--{{/if}}-->/>
				<label for="auth_sha">SHA</label>
				<span id ="auth_protocol" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>认证公钥</th>
			<td><input class="text wtd1" type="text" name="auth_passphrase" id="auth_passphrase" value="<!--{{$data.auth_passphrase}}-->"/></td>
		</tr>
		<tr>
			<th>密钥算法</th>
			<td>
				<input type="radio" id="priv_des" name="priv_protocol" value="0" <!--{{if 0 == $data.priv_protocol}}-->checked="checked"<!--{{/if}}-->/>
				<label for="priv_des">DES</label>
				<input type="radio" id="priv_aes" name="priv_protocol" value="1" <!--{{if 1 == $data.priv_protocol}}-->checked="checked"<!--{{/if}}-->/>
				<label for="priv_aes">AES</label>
				<span id ="priv_protocol" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>认证密钥</th>
			<td><input class="text wtd1" type="text" name="priv_passphrase" id="priv_passphrase" value="<!--{{$data.priv_passphrase}}-->"/></td>
		</tr>
	</tbody>
	<tbody id="version_community" <!--{{if 2 == $data.snmp_version}}-->style="display:none;"<!--{{/if}}-->>
		<tr>
			<th>共同体名</th>
			<td><input class="text wtd1" type="text" name="snmp_community" id="snmp_community" value="<!--{{$data.snmp_community}}-->"/></td>
		</tr>
	</tbody>
	<tbody>
		<tr>
			<th>获取数据方式</th>
			<td>
				<input type="radio" id="method_exec" name="snmp_method" value="0" <!--{{if 0 == $data.snmp_method}}-->checked="checked"<!--{{/if}}-->/>
				<label for="method_exec">EXEC</label>
				<input type="radio" id="method_ext" name="snmp_method" value="1"  <!--{{if 1 == $data.snmp_method}}-->checked="checked"<!--{{/if}}-->/>
				<label for="method_ext">EXT</label>
				<span id ="snmp_method" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 通讯协议</th>
			<td>
				<input type="radio" id="protocol_net" name="snmp_protocol" value="0"  <!--{{if 0 == $data.snmp_protocol}}-->checked="checked"<!--{{/if}}-->/>
				<label for="protocol_net">NET</label>
				<input type="radio" id="protocol_udp" name="snmp_protocol" value="1"  <!--{{if 1 == $data.snmp_protocol}}-->checked="checked"<!--{{/if}}-->/>
				<label for="protocol_udp">UDP</label>
				<span id ="snmp_protocol" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 超时时间</th>
			<td>
				<input class="text wtd1" type="text" name="snmp_timeout" id="timeout" value="<!--{{$data.snmp_timeout}}-->"/>
				<span  class="add-on add-on-left">毫秒</span>
				<span id="timeout_alias" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 重试次数</th>
			<td>
				<input class="text wtd1" type="text" name="snmp_retries" id="retries" value="<!--{{$data.snmp_retries}}-->"/>
				<span  class="add-on add-on-left">次</span>
				<span id="retries_alias" class="form_boxy_span" ></span>
			</td>
		</tr>
	</tbody>
	<!--{{else}}-->
	<tbody>
		<tr>
			<th>设备名称</th>
			<td><input class="text wtd1" type="text" name="device_name" id="device_name" value=""/></td>
		</tr>
		<tr>
			<th>设备显示名称</th>
			<td><input class="text wtd1" type="text" name="device_display_name" id="device_display_name" value=""/></td>
		</tr>
		<tr>
			<th>主机名-端口</th>
			<td>
				<input class="text wtd1" type="text" name="host" id="device_host" value=""/>
				<span  class="add-on add-on-mid">:</span>
				<input class="text wtd2" type="text" name="port" id="device_port" value="161"/>
				<span id="host_port" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 版本</th>
			<td>
				<input type="radio" id="version_one" name="snmp_version" value="0" checked/>
				<label for="version_one">VERSION_1</label>
				<input type="radio" id="version_two" name="snmp_version" value="1"/>
				<label for="version_two">VERSION_2</label>
				<input type="radio" id="version_three" name="snmp_version" value="2"/>
				<label for="version_three">VERSION_3</label>
				<span id ="snmp_version" class="form_boxy_span"></span>
			</td>
		</tr>
	</tbody>
	<tbody id="version_auth" style="display:none;">
		<tr>
			<th>认证用户名</th>
			<td><input class="text wtd1" type="text" name="security_name" id="security_name" value=""/></td>
		</tr>
		<tr>
			<th>安全等级</th>
			<td>
				<input type="radio" id="no_auth" name="security_level" value="0" checked/>
				<label for="no_auth">noAuthNoPriv</label>
				<input type="radio" id="auth_no_priv" name="security_level" value="1"/>
				<label for="auth_no_priv">authNoPriv</label>
				<input type="radio" id="auth_priv" name="security_level" value="2"/>
				<label for="auth_priv">authPriv</label>
				<span id ="security_level" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>认证算法</th>
			<td>
				<input type="radio" id="auth_md5" name="auth_protocol" value="0" checked/>
				<label for="auth_md5">MD5</label>
				<input type="radio" id="auth_sha" name="auth_protocol" value="1"/>
				<label for="auth_sha">SHA</label>
				<span id ="auth_protocol" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>认证公钥</th>
			<td><input class="text wtd1" type="text" name="auth_passphrase" id="auth_passphrase" value=""/></td>
		</tr>
		<tr>
			<th>密钥算法</th>
			<td>
				<input type="radio" id="priv_des" name="priv_protocol" value="0" checked/>
				<label for="priv_des">DES</label>
				<input type="radio" id="priv_aes" name="priv_protocol" value="1"/>
				<label for="priv_aes">AES</label>
				<span id ="priv_protocol" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>认证密钥</th>
			<td><input class="text wtd1" type="text" name="priv_passphrase" id="priv_passphrase" value=""/></td>
		</tr>
	</tbody>
	<tbody id="version_community">
		<tr>
			<th>共同体名</th>
			<td><input class="text wtd1" type="text" name="snmp_community" id="snmp_community" value=""/></td>
		</tr>
	</tbody>
	<tbody>
		<tr>
			<th>获取数据方式</th>
			<td>
				<input type="radio" id="method_exec" name="snmp_method" value="0" checked/>
				<label for="method_exec">EXEC</label>
				<input type="radio" id="method_ext" name="snmp_method" value="1"/>
				<label for="method_ext">EXT</label>
				<span id ="snmp_method" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 通讯协议</th>
			<td>
				<input type="radio" id="protocol_net" name="snmp_protocol" value="0" checked/>
				<label for="protocol_net">NET</label>
				<input type="radio" id="protocol_udp" name="snmp_protocol" value="1"/>
				<label for="protocol_udp">UDP</label>
				<span id ="snmp_protocol" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 超时时间</th>
			<td>
				<input class="text wtd1" type="text" name="snmp_timeout" id="timeout" value="5000"/>
				<span  class="add-on add-on-left">毫秒</span>
				<span id="timeout_alias" class="form_boxy_span"></span>
			</td>
		</tr>
		<tr>
			<th>SNMP 重试次数</th>
			<td>
				<input class="text wtd1" type="text" name="snmp_retries" id="retries" value="3"/>
				<span  class="add-on add-on-left">次</span>
				<span id="retries_alias" class="form_boxy_span" ></span>
			</td>
		</tr>
	</tbody>
	<!--{{/if}}-->
	</table>
	</form>
	<div class="empty_line"></div>
	<div class="button_bottom">
		<button class="btn" onclick="gDeviceManage.handle('<!--{{$mode}}-->')" style="margin-left:30%">确 定</button>
		<button class="btn" id="reset_form">重 置</button>
	</div>
</div>
</div>
</body>
</html>
